#include <iostream>
#include <string>
#include <algorithm>
#include <map>

using namespace std;

void print_key_value(map<int,string> & input){
    for(map<int,string>::iterator it=input.begin();it!=input.end();it++){
        cout<<"key: "<<it->first<<endl<<"value: "<<it->second<<endl;
    }
}
//test1
void test01(){
    //这里的话，我用于设置int，string
    map<int,string> map_test1;
    map_test1.insert(pair<int,string>(1,"zhang"));
    map_test1.insert(make_pair(2,"liu"));
    map_test1.insert(map<int,string>::value_type(3,"sex"));
    map_test1[3]="ceshikeyValue";
    map_test1[4]="keyValue";
    print_key_value(map_test1);
}

void test02(){
    //用于测试替换删除功能
    map<int,string> mapNew;
    mapNew.insert(make_pair(3,"zhang"));
    mapNew.insert(pair<int,string>(4,"ceshi1"));
    mapNew.insert(map<int,string>::value_type(5,"wu"));
    //print_key_value(mapNew);
    //mapNew.clear(); //删除所有元素
    auto itnum=mapNew.erase(2);
    cout<<itnum<<endl;

    // print_key_value(mapNew);
    // cout<<"the element is deleted all "<<endl;
}
 
void test03(){
    map<int,string> mapNew;
    mapNew.insert(make_pair(3,"zhang"));
    mapNew.insert(pair<int,string>(4,"ceshi1"));
    mapNew.insert(map<int,string>::value_type(5,"wu"));

    // auto it=mapNew.find(3);
    // cout<<it->second<<endl;

    auto low_it=mapNew.lower_bound(1);
    cout<<low_it->first<<endl;
}


//主函数，用于验证代码的准确性的
int main()
{   
    test03();
    cout<<"testcout"<<endl;
}